package StringExercise;
//boolean startsWith(String s)字符串是否以(s)开头
//boolean endsWith(String s)字符串是否以(s)结尾
public class StartsWithDemo1 {
    public static void main(String[] args) {
        String str1="thinking in Java";
        boolean starts1=str1.startsWith("think");
        System.out.println(starts1);
        boolean ends1=str1.endsWith("abc");
        System.out.println(ends1);

        String str2="活着，是为了改变世界!";
        boolean starts2=str2.startsWith("abc");
        System.out.println(starts2);
        boolean ends2=str2.endsWith("!");
        System.out.println(ends2);


    }
}
